﻿Imports Microsoft.Office.Tools.Ribbon

Public Class Ribbon1
    Private ctrlTaskPane As CustomTaskPane

    Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
      

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button2.Click
      

        ' Format Excel columns for import marketinglist member
        Dim sheet As Excel.Worksheet
        sheet = Globals.ThisAddIn.Application.ActiveSheet()
        sheet.Cells(1, 1).Value = "Account"
        sheet.Cells(1, 2).Value = "AccountId"

        sheet.Cells(1, 3).Value = "Contact"
        sheet.Cells(1, 4).Value = "ContactId"

        sheet.Cells(1, 5).Value = "Lead"
        sheet.Cells(1, 6).Value = "LeadId"


        Dim rng As Excel.Range
        With Globals.ThisAddIn.Application
            ' Set header format
            rng = .Range("A1", "F1")
            rng.Font.Bold = True
            rng.Font.Size = 12

            '' Hide columns 
            'rng = .Columns(2)
            'rng.Hidden = True

            'rng = .Columns(4)
            'rng.Hidden = True

            'rng = .Columns(6)
            'rng.Hidden = True

        End With
        rng = Nothing


        sheet = Nothing
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button1.Click
        ' Show task Pane
        ctrlTaskPane = New CustomTaskPane()
        Dim ctp As Microsoft.Office.Tools.CustomTaskPane
        ctp = Globals.ThisAddIn.CustomTaskPanes.Add(ctrlTaskPane, "My Task Pane")
        ctp.Visible = True
    End Sub
End Class
